<?php
/**
 * @author shutyuka@gmail.com
 * @modified 2011-02-20
 */
class AdminEmail
{
	const SECRET_KEY = '@4!@#$%@';
	
	static public $PREENGAGE_TYPE = 1;
	
	static public $STATUS_ACTIVATE = 10;
	
	static public $TABLE_NAME="admin_email";
	
	static public function GenPassword($p) {
		return md5($p . self::SECRET_KEY);
	}

	static public function Create($email, $adminType) {
		$user_row = array();
		$user_row['email'] = $email;
		$user_row['type'] = $adminType;
		DB::Insert(self::$TABLE_NAME, $user_row);
		return ;
	}

	
	
	static public function GetAll(){
		$all = DB::LimitQuery(self::$TABLE_NAME);
		return $all;
	}
	
	static public function DelAuth($email, $type){
		$sql = "delete from ".self::$TABLE_NAME." where  email=$email and type=$type";
		DB::Query($sql);
		return ;
	}
}
